<?php
$username=trim($_POST['username']);
$password=trim($_POST['password']);
if(empty($username) || empty($password)){
    header("location:./1.html");
}
$user=['name'=>'user','password'=>'123456'];
if($user['name'] !== $username){
    echo "用户名错误";
    header("Refresh:5;url=./login.html");
}
if($user['password'] !== $password){
    echo"密码错误";
    header("Refresh:5;url=./1.html");
}
@session_start(['cookie_httponly'=>true]);
$_SESSION["user"]=['name'=>$username,'password'=>$password];
header("location:./log.php");